<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="robots" content="index, follow, all" />
    <title>Imagine\File\Loader | Imagine API v1.2.5-dev</title>

            <link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="../../css/bootstrap-theme.min.css">
        <link rel="stylesheet" type="text/css" href="../../css/sami.css">
        <script src="../../js/jquery-1.11.1.min.js"></script>
        <script src="../../js/bootstrap.min.js"></script>
        <script src="../../js/typeahead.min.js"></script>
        <script src="../../sami.js"></script>
        <meta name="MobileOptimized" content="width">
        <meta name="HandheldFriendly" content="true">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
    
    
    </head>

    <body id="class" data-name="class:Imagine_File_Loader" data-root-path="../../">
            <div id="content">
        <div id="left-column">
                <div id="control-panel">
                <script>
            $('option[data-version="'+window.projectVersion+'"]').prop('selected', true);
        </script>
        <form id="search-form" action="../../search.html" method="GET">
            <span class="glyphicon glyphicon-search"></span>
            <input name="search"
                   class="typeahead form-control"
                   type="search"
                   placeholder="Search">
        </form>
    </div>

                <div id="api-tree"></div>

        </div>
        <div id="right-column">
                <nav id="site-nav" class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-elements">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="../../index.html">Imagine API v1.2.5-dev</a>
            </div>
            <div class="collapse navbar-collapse" id="navbar-elements">
                <ul class="nav navbar-nav">
                    <li><a href="../../classes.html">Classes</a></li>
                                            <li><a href="../../namespaces.html">Namespaces</a></li>
                                        <li><a href="../../interfaces.html">Interfaces</a></li>
                    <li><a href="../../traits.html">Traits</a></li>
                    <li><a href="../../doc-index.html">Index</a></li>
                    <li><a href="../../search.html">Search</a></li>
                </ul>
            </div>
        </div>
    </nav>

                        <div class="namespace-breadcrumbs">
            <ol class="breadcrumb">
                <li><span class="label label-default">class</span></li>
                        <li><a href="../../Imagine.html">Imagine</a></li><li class="backslash">\</li><li><a href="../../Imagine/File.html">File</a></li><li class="backslash">\</li><li>Loader</li>
            </ol>
        </div>
                <div id="page-content">
                
    <div class="page-header">
        <h1>
            Loader
                
        </h1>
    </div>

    <p>    class
    <strong>Loader</strong>        implements
        <a href="../../Imagine/File/LoaderInterface.html"><abbr title="Imagine\File\LoaderInterface">LoaderInterface</abbr></a>
</p>

        
    

            <div class="description">
            <p>Default implementation of Imagine\File\LoaderInterface.</p>                                </div>
    
    
            <h2>Constants</h2>

            <table class="table table-condensed">
                    <tr>
                <td>MINIMUM_CURL_VERSION</td>
                <td class="last">
                    <p><em>The mimimum supported version of curl.</em></p>
                    <p></p>
                </td>
            </tr>
            </table>

    
            <h2>Properties</h2>

            <table class="table table-condensed">
                    <tr>
                <td class="type" id="property_path">
                                        protected                                        string
                </td>
                <td>$path</td>
                <td class="last">The file path.</td>
                <td></td>
            </tr>
                    <tr>
                <td class="type" id="property_isUrl">
                                        protected                                        bool
                </td>
                <td>$isUrl</td>
                <td class="last">Does $path contain an URL?</td>
                <td></td>
            </tr>
                    <tr>
                <td class="type" id="property_data">
                                        protected                                        string|null
                </td>
                <td>$data</td>
                <td class="last">The loaded data.</td>
                <td></td>
            </tr>
                    <tr>
                <td class="type" id="property_isCurlSupported">
                                        protected                                        bool|null
                </td>
                <td>$isCurlSupported</td>
                <td class="last">Is curl available, with a decent version?</td>
                <td></td>
            </tr>
            </table>

    
            <h2>Methods</h2>

            <div class="container-fluid underlined">
                    <div class="row">
                <div class="col-md-2 type">
                    
                </div>
                <div class="col-md-8 type">
                    <a href="#method___construct">__construct</a>(string|mixed $path)
        
                                            <p>Initialize the instance.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    bool
                </div>
                <div class="col-md-8 type">
                    <a href="#method_isLocalFile">isLocalFile</a>()
        
                                            <p>Is this a local file.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    string
                </div>
                <div class="col-md-8 type">
                    <a href="#method_getPath">getPath</a>()
        
                                            <p>Get the path of the file (local or remote).</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    bool
                </div>
                <div class="col-md-8 type">
                    <a href="#method_hasReadData">hasReadData</a>()
        
                                            <p>Is the binary content already loaded?</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    string
                </div>
                <div class="col-md-8 type">
                    <a href="#method_getData">getData</a>()
        
                                            <p>Get the file binary contents.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    string
                </div>
                <div class="col-md-8 type">
                    <a href="#method___toString">__toString</a>()
        
                                            <p>The string representation of this object must be the file path (local or remote).</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    string
                </div>
                <div class="col-md-8 type">
                    <a href="#method_readLocalFile">readLocalFile</a>()
        
                                            <p>Read a local file.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
                </div>
                <div class="col-md-8 type">
                    <a href="#method_checkLocalFile">checkLocalFile</a>()
        
                                            <p>Check that the file exists and it's readable.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    string
                </div>
                <div class="col-md-8 type">
                    <a href="#method_readRemoteFile">readRemoteFile</a>()
        
                                            <p>Read a remote file.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    bool
                </div>
                <div class="col-md-8 type">
                    <a href="#method_isCurlSupported">isCurlSupported</a>()
        
                                            <p>Check if curl is available and it's a decent version.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    string
                </div>
                <div class="col-md-8 type">
                    <a href="#method_readRemoteFileWithCurl">readRemoteFileWithCurl</a>()
        
                                            <p>Read a remote file using the cURL extension.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
                </div>
                <div class="col-md-8 type">
                    <a href="#method_setCurlOptions">setCurlOptions</a>(resource $curl)
        
                                            <p>Set curl options.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    string
                </div>
                <div class="col-md-8 type">
                    <a href="#method_readRemoteFileWithFileGetContents">readRemoteFileWithFileGetContents</a>()
        
                                            <p>Read a remote file using the file_get_contents.</p>                </div>
                <div class="col-md-2"></div>
            </div>
            </div>


        <h2>Details</h2>

            <div id="method-details">
                    <div class="method-item">
                    <h3 id="method___construct">
        <div class="location">at         line 61</div>
        <code>                    
    <strong>__construct</strong>(string|mixed $path)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Initialize the instance.</p>                                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>string|mixed</td>
                <td>$path</td>
                <td>the file path (or an object whose string representation is the file path)</td>
            </tr>
            </table>

            
            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Imagine/Exception/InvalidArgumentException.html"><abbr title="Imagine\Exception\InvalidArgumentException">InvalidArgumentException</abbr></a></td>
                <td>throws an InvalidArgumentException is $path is an empty string, or is not an object that has a __toString method</td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_isLocalFile">
        <div class="location">at         line 82</div>
        <code>                    bool
    <strong>isLocalFile</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Is this a local file.</p>                                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>bool</td>
            <td></td>
        </tr>
    </table>

            
            
                            <h4>See also</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
                                            <a href="../../Imagine/File/LoaderInterface.html#method_isLocalFile"><abbr title="Imagine\File\LoaderInterface">LoaderInterface</abbr>::isLocalFile</a>
                                    </td>
                <td></td>
            </tr>
            </table>

                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_getPath">
        <div class="location">at         line 92</div>
        <code>                    string
    <strong>getPath</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Get the path of the file (local or remote).</p>                                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>string</td>
            <td></td>
        </tr>
    </table>

            
            
                            <h4>See also</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
                                            <a href="../../Imagine/File/LoaderInterface.html#method_getPath"><abbr title="Imagine\File\LoaderInterface">LoaderInterface</abbr>::getPath</a>
                                    </td>
                <td></td>
            </tr>
            </table>

                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_hasReadData">
        <div class="location">at         line 102</div>
        <code>                    bool
    <strong>hasReadData</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Is the binary content already loaded?</p>                                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>bool</td>
            <td></td>
        </tr>
    </table>

            
            
                            <h4>See also</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
                                            <a href="../../Imagine/File/LoaderInterface.html#method_hasReadData"><abbr title="Imagine\File\LoaderInterface">LoaderInterface</abbr>::hasReadData</a>
                                    </td>
                <td></td>
            </tr>
            </table>

                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_getData">
        <div class="location">at         line 115</div>
        <code>                    string
    <strong>getData</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Get the file binary contents.</p>                                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>string</td>
            <td></td>
        </tr>
    </table>

            
            
                            <h4>See also</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
                                            <a href="../../Imagine/File/LoaderInterface.html#method_getData"><abbr title="Imagine\File\LoaderInterface">LoaderInterface</abbr>::getData</a>
                                    </td>
                <td></td>
            </tr>
            </table>

                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method___toString">
        <div class="location">at         line 133</div>
        <code>                    string
    <strong>__toString</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>The string representation of this object must be the file path (local or remote).</p>                                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>string</td>
            <td></td>
        </tr>
    </table>

            
            
                            <h4>See also</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
                                            <a href="../../Imagine/File/LoaderInterface.html#method___toString"><abbr title="Imagine\File\LoaderInterface">LoaderInterface</abbr>::__toString</a>
                                    </td>
                <td></td>
            </tr>
            </table>

                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_readLocalFile">
        <div class="location">at         line 145</div>
        <code>            protected        string
    <strong>readLocalFile</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Read a local file.</p>                                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>string</td>
            <td></td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Imagine/Exception/InvalidArgumentException.html"><abbr title="Imagine\Exception\InvalidArgumentException">InvalidArgumentException</abbr></a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_checkLocalFile">
        <div class="location">at         line 161</div>
        <code>            protected        
    <strong>checkLocalFile</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Check that the file exists and it's readable.</p>                                                </div>
                <div class="tags">
            
            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Imagine/Exception/InvalidArgumentException.html"><abbr title="Imagine\Exception\InvalidArgumentException">InvalidArgumentException</abbr></a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_readRemoteFile">
        <div class="location">at         line 179</div>
        <code>            protected        string
    <strong>readRemoteFile</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Read a remote file.</p>                                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>string</td>
            <td></td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Imagine/Exception/InvalidArgumentException.html"><abbr title="Imagine\Exception\InvalidArgumentException">InvalidArgumentException</abbr></a></td>
                <td></td>
            </tr>
                    <tr>
                <td><a href="../../Imagine/Exception/RuntimeException.html"><abbr title="Imagine\Exception\RuntimeException">RuntimeException</abbr></a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_isCurlSupported">
        <div class="location">at         line 193</div>
        <code>            protected        bool
    <strong>isCurlSupported</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Check if curl is available and it's a decent version.</p>                                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>bool</td>
            <td></td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_readRemoteFileWithCurl">
        <div class="location">at         line 218</div>
        <code>            protected        string
    <strong>readRemoteFileWithCurl</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Read a remote file using the cURL extension.</p>                                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>string</td>
            <td></td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Imagine/Exception/InvalidArgumentException.html"><abbr title="Imagine\Exception\InvalidArgumentException">InvalidArgumentException</abbr></a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_setCurlOptions">
        <div class="location">at         line 259</div>
        <code>            protected        
    <strong>setCurlOptions</strong>(resource $curl)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Set curl options.</p>                                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>resource</td>
                <td>$curl</td>
                <td></td>
            </tr>
            </table>

            
            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Imagine/Exception/RuntimeException.html"><abbr title="Imagine\Exception\RuntimeException">RuntimeException</abbr></a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_readRemoteFileWithFileGetContents">
        <div class="location">at         line 287</div>
        <code>            protected        string
    <strong>readRemoteFileWithFileGetContents</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Read a remote file using the file_get_contents.</p>                                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>string</td>
            <td></td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Imagine/Exception/InvalidArgumentException.html"><abbr title="Imagine\Exception\InvalidArgumentException">InvalidArgumentException</abbr></a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
            </div>

    
            </div>
                <div id="footer">
        Generated by <a href="http://sami.sensiolabs.org/">Sami, the API Documentation Generator</a>.
    </div>

        </div>
    </div>
    </body>

</html>
